#ifndef ENGINE_GASSERT_H
#define ENGINE_GASSERT_H

#include <apoget.h>

class POGET_API Game;
//class POGET_API Log;
class POGET_API GAssert
{
	GAssert() {}
	GAssert(const GAssert&);
	GAssert& operator=(const GAssert&);
	static GAssert theInstance;
	bool quietMode;
	Game*	game;

public:
	static GAssert& getInstance();
	void HandleSkippableAssert( const char* file_name, const char* function_name, 
		int line_number, const char* expr, const char* fmt, ... );
	bool initialize(bool quiet = true);
	bool initialize(Game* ptrGame, bool quiet = true);
	bool shutdown();
};

#define gAssertManager GAssert::getInstance()

#define ASSERT( expression, format, ... )\
(\
  ( ( expression ) ? \
    true :\
    (\
      GAssert::getInstance().HandleSkippableAssert( __FILE__, __FUNCTION__, __LINE__, #expression, format, ##__VA_ARGS__ ),\
      false\
    )\
  )\
)


#endif